﻿@model MSAcademic.v2.Web.Areas.Admin.Models.Gallery.EditGalleryViewModel
@{
    ViewBag.Title = "Dodavanje slike u spremište " + Model.GalleryName;
}

<h2>Dodavanje slike u spremište @Html.RouteLink(Model.Gallery.Name, "ShowGallery", new { galleryId = Model.Gallery.Id })</h2>

<div class="editGallery">
    <div class="forms">
        @if (!string.IsNullOrWhiteSpace(Model.ErrorMessage))
        {
            <div class="field-validation-error">@Model.ErrorMessage</div>
        }

        <h3>Koristi file upload</h3>
        @using (Html.BeginForm("UploadPicturesToGallery", "Gallery", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            @Html.HiddenFor(m => m.GalleryId)

            <input type="file" name="pic" />
            
            <div class="actions-wrapper clearfix">
                <a class="positive submit">Spremi promjene <i class="icon-ok"></i></a> 
            </div>
        }
    

        <h3>Koristi URL upload</h3>
        <p class="note">Napomena: slike s nekih URL-ova nije moguće preuzeti i pohraniti u spremište.</p>
        @using (Html.BeginForm("DownloadAndUploadPicturesToGallery", "Gallery", FormMethod.Post))
        {
            @Html.HiddenFor(m => m.GalleryId)

            @Html.TextBoxFor(m => m.Url, new { @placeholder = "Unesi URL slike koju želiš pohraniti u spremište" })

            <div class="actions-wrapper clearfix">
                <a class="positive submit">Spremi promjene <i class="icon-ok"></i></a> 
            </div>
        }

    </div>

</div>
